package aes.a2;

import java.util.Random;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService()
public class SupplierWS {

	@WebMethod()
	public String getBrands() {
		
		Supplier supplier = Supplier.getInstance();
		String brandList = supplier.getBrands();
	    System.out.println(brandList);
	    return brandList;
	}
	
	@WebMethod()
	public String getModels(String brandName) {
		Supplier supplier = Supplier.getInstance();
		String modelList = supplier.getModel(brandName);
	    System.out.println(modelList);
	    return modelList;
	}
	
	@WebMethod()
	public String getDetails(String brandName, String modelName) {
		Supplier supplier = Supplier.getInstance();
		String model = supplier.getDetails(brandName, modelName);
	    System.out.println(model);
	    return model;
	}
	
	@WebMethod()
	public boolean order(String brandName, String modelName) {
	    return (new Random()).nextBoolean();
	}
}
